package com.icity.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class Tets {
//	public static void main(String[] args) {
//		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
//		String date = "Fri Jan 04 2019 00:00:00 GMT 0800 (中国标准时间)";
//		try {
//			System.out.println(sdf.parse(date));
//		} catch (ParseException e) {
//			e.printStackTrace();
//		}
//	}

	public static List<String> getWeekDay(Date nowDate, int days) {
		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
		String date = sdf.format(nowDate);
		List<String> list = new ArrayList<String>();
		for (int i = days - 1; i >= 0; i--) {
			list.add(DateUtils.getSpecifiedDayBefore(date, i));
		}
		return list;
	}

	public static List<String> getDay(String startDate, String endDate) {
		int days = (int) DateUtils.getDaySub(startDate, endDate);
		List<String> list = new ArrayList<String>();
		for (int i = days - 1; i >= 0; i--) {
			list.add(DateUtils.getSpecifiedDayBefore(endDate, i));
		}
		return list;
	}

}
